home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / READFONT.H < prev    next >
Text File  |  1988-05-30  |  1KB  |  42 lines

  1. /* -*-C-*- readfont.h */
  2. /*-->readfont*/
  3. /**********************************************************************/
  4. /****************************** readfont ******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. readfont(font_k)
  9. INT32 font_k;
  10. {
  11.     BYTE a, l;
  12.     UNSIGN32 c;                /* checksum */
  13.     UNSIGN32 d;                /* design size */
  14.     char n[MAXSTR];
  15.     UNSIGN32 s;                /* scale factor */
  16.     struct font_entry *tfontptr;     /* temporary font_entry pointer */
  17.  
  18.     c = nosignex(dvifp,(BYTE)4);
  19.     s = nosignex(dvifp,(BYTE)4);
  20.     d = nosignex(dvifp,(BYTE)4);
  21.     a = (BYTE)nosignex(dvifp,(BYTE)1);
  22.     l = (BYTE)nosignex(dvifp,(BYTE)1);
  23.     (void)getbytes(dvifp, n, (BYTE)(a+l));
  24.     n[a+l] = '\0';
  25.     tfontptr = (struct font_entry*)MALLOC((unsigned)sizeof(struct font_entry));
  26.     if (tfontptr == (struct font_entry *)NULL)
  27.     (void)fatal(
  28.         "readfont():  No allocable memory space left for font_entry");
  29.     tfontptr->next = hfontptr;
  30.  
  31.     fontptr = hfontptr = tfontptr;
  32.     fontptr->k = font_k;
  33.     fontptr->c = c;
  34.     fontptr->s = s;
  35.     fontptr->d = d;
  36.     fontptr->a = a;
  37.     fontptr->l = l;
  38.     (void)strcpy(fontptr->n, n);
  39.     fontptr->font_space = (INT32)(s/6);
  40.     (void)reldfont(fontptr);
  41. }
  42.